# This is a sample Python script.
import main_untitled
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
# coding=utf-8
import select, socket, queue
import sys
import threading
import os
import time
import binascii
import struct
import configparser
import random
from main_untitled import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.Qt import QThread
import datetime

u8_lit = struct.Struct('B')
s8_lit = struct.Struct('b')
u16_lit = struct.Struct('<H')
s16_lit = struct.Struct('<h')
u32_lit = struct.Struct('<I')
s32_lit = struct.Struct('<i')
u64_lit = struct.Struct('<Q')
s64_lit = struct.Struct('<q')
double_lit = struct.Struct('<d')
float_lit = struct.Struct('<f')
u16_big = struct.Struct('>H')
s16_big = struct.Struct('>h')
u32_big = struct.Struct('>I')
s32_big = struct.Struct('>i')
u64_big = struct.Struct('>Q')
s64_big = struct.Struct('>q')
double_big = struct.Struct('>d')
float_big = struct.Struct('>f')


class mian_window(QMainWindow):
    pass

    def set_ui(self, hd):
        pass

    def slot_frame_decode(self):
        pass


def printf_except_info(e):
    msg = '{}:{} {} '.format(e.__traceback__.tb_frame.f_globals["__file__"], e.__traceback__.tb_lineno, e)
    # QMessageBox.information('错误',msg)
    print(msg)


def main_func():
    try:
        ui = Ui_MainWindow()
        app = QApplication(sys.argv)
        MainWindow = mian_window()
        ui.setupUi(MainWindow)
        MainWindow.show()
        MainWindow.set_ui(ui)
        sys.exit(app.exec_())
    except Exception as e:
        printf_except_info(e)
        sys.exit()


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    main_func()

# See PyCharm help at https://www.jetbrains.com/help/pycharm/
